//package com.example.myproject.redis.redission.service;
//
//import com.example.myproject.redis.redisother.ApolloRedisProperties;
//import org.redisson.Redisson;
//import org.redisson.api.RedissonClient;
//import org.redisson.client.codec.Codec;
//import org.redisson.config.Config;
//import org.redisson.config.SingleServerConfig;
//import org.springframework.beans.BeanUtils;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.context.annotation.Lazy;
//import org.springframework.util.StringUtils;
//@Configuration
//public class RedisessionAutoConfiguration {
//
//    @Autowired
//    private ApolloRedisProperties redisProperties;
//
//    @Autowired
//    private CoredissonProperties coredissonProperties;
//
//
//    @Bean
//    @Lazy
//    public RedissonClient redissonClient() throws Exception {
//        Config config = new Config();
//        if (!StringUtils.isEmpty(this.coredissonProperties.getCodecClass())) {
//            config.setCodec((Codec)Class.forName(this.coredissonProperties.getCodecClass()).newInstance());
//        }
//        SingleServerConfig baseConfig = config.useSingleServer();
//        BeanUtils.copyProperties(this.coredissonProperties, baseConfig);
//        baseConfig.setPassword(redisProperties.getPassword());
//        baseConfig.setAddress("redis://127.0.0.1:6379");
//        return Redisson.create(config);
//    }
//
////    @Bean
////    @Lazy
////    public RedissonClient redissonClient2() throws Exception {
////        Config config = new Config();
////        if (!StringUtils.isEmpty(this.coredissonProperties.getCodecClass())) {
////            config.setCodec((Codec)Class.forName(this.coredissonProperties.getCodecClass()).newInstance());
////        }
////        SingleServerConfig baseConfig = config.useSingleServer();
////        BeanUtils.copyProperties(this.coredissonProperties, baseConfig);
////        baseConfig.setPassword(redisProperties.getPassword());
////        baseConfig.setAddress("redis://127.0.0.1:6380");
////        return Redisson.create(config);
////    }
////
////
////    @Bean
////    @Lazy
////    public RedissonClient redissonClient3() throws Exception {
////        Config config = new Config();
////        if (!StringUtils.isEmpty(this.coredissonProperties.getCodecClass())) {
////            config.setCodec((Codec)Class.forName(this.coredissonProperties.getCodecClass()).newInstance());
////        }
////        SingleServerConfig baseConfig = config.useSingleServer();
////        BeanUtils.copyProperties(this.coredissonProperties, baseConfig);
////        baseConfig.setPassword(redisProperties.getPassword());
////        baseConfig.setAddress("redis://127.0.0.1:6381");
////        return Redisson.create(config);
////    }
//
//}
